package com.task;


import cn.hutool.extra.mail.MailUtil;
import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author: xuan
 * @Date: 2024/7/3 12:12
 * @Version: 1.0
 */
//@Component
//@Slf4j
//public class Consumer {
//    @RabbitListener(queues="queueReview")
//    public void doqueueReview(String str, Channel channel, Message message){
//
//        System.out.println("str:"+str);
//        String[] msg = str.split("-");
//        MailUtil.send(msg[0], "工作通知", msg[1], false);
//        log.info("成功处理消息"+msg[0]);
//    }
//    @RabbitListener(queues="queueNumWarning")
//    public void doqueueNumWarning(String str, Channel channel, Message message){
//
//        System.out.println("str:"+str);
//        String[] msg = str.split("-");
//        MailUtil.send(msg[0], "库存预警", msg[1], false);
//        log.info("成功处理消息"+msg[0]);
//    }
//}
